#include "TestWrapper.h"

// implementation code of WrapperFactory - do NOT modify the next 5 lines
AbstractWrapper* WrapperFactory::wrapper = 0;
AbstractWrapper* WrapperFactory::createWrapper() {
  if (wrapper == 0) wrapper = new TestWrapper;
  return wrapper;
}
// Do not modify the following line
volatile bool TestWrapper::GlobalStop = false;

// a default constructor
TestWrapper::TestWrapper() {
  // create any objects here as instance variables of this class
  // as well as any initialization required for your spa program
}

// method for parsing the SIMPLE source
void TestWrapper::parse(std::string filename) {
	// call your parser to do the parsing
  // ...rest of your code...
	_parser = Parser(filename);
	_pkb = PKB(&_parser);
	_designExtractor = DesignExtractor(&_pkb);
}

// method to evaluating a query
void TestWrapper::evaluate(std::string query, std::list<std::string>& results){
// call your evaluator to evaluate the query here
  // ...code to evaluate query...

	//QueryProcessor qp = QueryProcessor(query, &ast, &varTable, &patternTable, &constTable, &procTable, &follows, &parent, &modifies, &uses);
	QueryProcessor	_queryProcessor = QueryProcessor(&_pkb);
	try{
		results = _queryProcessor.processingQuery(query);
	}
	catch (exception& e){
		results.push_back(e.what());
	}
  // store the answers to the query in the results list (it is initially empty)
  // each result must be a string.
}



